import React from 'react'
import { Outlet, useLocation, useNavigate } from 'react-router-dom'
import { Badge, TabBar } from 'antd-mobile'

function Tabbar() {
    const navigate=useNavigate();
    const pathname=useLocation();
  return (
    <div>
      <Outlet></Outlet>
      <div activekey={pathname}>
        <TabBar style={{position:"fixed", bottom:"0", width:"100%", background:"#ccc"}} onChange={(key)=>navigate(key)}>
            <TabBar.Item key={'/'} title={"首页"}></TabBar.Item>
            <TabBar.Item key={'/user'} title={"我的"}></TabBar.Item>
        </TabBar>
      </div>
    </div>
  )
}

export default Tabbar
